﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.Model.DTO
{
    public class StocktakingDto
    { 
        /// <summary>
      /// 盘点订单Id
      /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 订单号
        /// </summary>
        public string OrderSn { get; set; }
        /// <summary>
        /// 库房Id
        /// </summary>
        public int WarehouseId { get; set; }
        public string WarehouseCode { get; set; }
        /// <summary>
        /// 库房
        /// </summary>
        public string WarehouseName { get; set; }

        /// <summary>
        /// 单据类型Id
        /// </summary>
        public int? BillType { get; set; }
        /// <summary>
        /// 0：待打印1.待盘点 2，已盘点，3.已打印
        /// 单据状态：0-创建;1-提交;2-审核通过;3-作业中；4-已完成;5-强制完成;6-失效；7-异常
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 物料Id
        /// </summary>
        public int? MaterialId { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// 批次号
        /// </summary>
        public string BatchNo { get; set; }
        /// <summary>
        /// 盘点计划：10-普通抽盘；20-临时抽盘；30-紧急抽盘；40-货主抽盘；50-库区抽盘；
        /// </summary>
        public int PlanType { get; set; }
        /// <summary>
        /// 盘点方法：0-全部盘点；10-不盘30天已盘点的库区；20-不盘15天已盘点的库区；30-不盘7天内已盘点的库区；
        /// </summary>
        public int StocktakeWay { get; set; }

        /// <summary>
        /// 库位数量
        /// </summary>
        public int CellCount { get; set; }
        /// <summary>
        /// 完成数量//盘点订单的数量
        /// </summary>
        public int FinishedCount { get; set; }
        /// <summary>
        /// 循环次数
        /// </summary>
        public int LoopTimes { get; set; }
        /// <summary>
        /// 优先级
        /// </summary>
        public int PriorityLevel { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        ///// 创建人Id
        ///// </summary>
        //public int? CreateUserId { get; set; }
        ///// <summary>
        ///// 创建人
        ///// </summary>
        //public string CreateUserName { get; set; }
        ///// <summary>
        ///// 创建时间
        ///// </summary>
        //public DateTime CreateDate { get; set; }
        ///// <summary>
        ///// 修改人Id
        ///// </summary>
        //public int? ModifyUserId { get; set; }
        ///// <summary>
        ///// 修改人
        ///// </summary>
        //public string ModifyUserName { get; set; }
        ///// <summary>
        ///// 修改时间
        ///// </summary>
        //public DateTime? ModifyDate { get; set; }
        ///// <summary>
        ///// 提交时间
        ///// </summary>
        //public DateTime? SubmitDate { get; set; }
        ///// <summary>
        ///// 提交人Id
        ///// </summary>
        //public int? SubmitUserId { get; set; }
        ///// <summary>
        ///// 提交人
        ///// </summary>
        //public string SubmitUserName { get; set; }
        ///// <summary>
        ///// 审核时间
        ///// </summary>
        //public DateTime? AuditDate { get; set; }
        ///// <summary>
        ///// 审核人Id
        ///// </summary>
        //public int? AuditUserId { get; set; }
        ///// <summary>
        ///// 审核人
        ///// </summary>
        //public string AuditUserName { get; set; }

        public List<StocktakingDtoChild> child {  get; set; } = new List<StocktakingDtoChild>();
    }

    public class StocktakingDtoChild
    {
        /// <summary>
        /// 订单明细主键
        /// </summary>
        public int Id { get; set; }
        /// <summary>
        /// 盘点单Id
        /// </summary>
        public int OrderId { get; set; }
        /// <summary>
        /// 盘点单号
        /// </summary>
        public string OrderSn { get; set; }
        /// <summary>
        /// 仓位Id
        /// </summary>
        public int? CellId { get; set; }
        /// <summary>
        /// 仓位编码
        /// </summary>
        public string CellCode { get; set; }

        /// <summary>
        /// 货位名称
        /// </summary>
        public string LocationName { get; set; }


        public int? CellDepthIndex { get; set; }
        /// <summary>
        /// 垛条码
        /// </summary>
        public string PalletBarcode { get; set; }

        /// <summary>
        /// 0：待盘点，1已盘点
        /// 状态：0-创建、1-进行中、2-完成、3-已取消
        /// </summary>
        public int Status { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateDate { get; set; }
        /// <summary>
        /// 物料Id
        /// </summary>
        public int? MaterialId { get; set; }
        /// <summary>
        /// 物料号
        /// </summary>
        public string MaterialCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        public string MaterialName { get; set; }
        /// <summary>
        /// 是否有货号详情
        /// </summary>
        public bool? HasSkuDetail { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? Qty { get; set; }

        /// <summary>
        /// 确认数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]

        public decimal? ContentQty { get; set; }
        /// <summary>
        /// 质量状态：0-待检；1-合格；2-不合格；
        /// </summary>
        public int? QualityState { get; set; }
        /// <summary>
        /// 详细批次
        /// </summary>
        public string BatchNo { get; set; }

        /// <summary>
        /// 小批次号
        /// </summary>
        public string SmallBatchNo { get; set; }
        /// <summary>
        /// 货主Id
        /// </summary>
        public int? OwnerId { get; set; }
        /// <summary>
        /// 货主
        /// </summary>
        public string OwnerName { get; set; }
        ///// <summary>
        ///// 有效时间
        ///// </summary>
        //public DateTime? ExpireDate { get; set; }
        ///// <summary>
        ///// 生产日期
        ///// </summary>
        //public DateTime? ProductDate { get; set; }
        ///// <summary>
        ///// 供应商Id
        ///// </summary>
        //public int? SupplierId { get; set; }
        ///// <summary>
        ///// 供应商每次
        ///// </summary>
        //public string SupplierName { get; set; }
        ///// <summary>
        ///// 物料类型Id
        ///// </summary>
        //public int? MaterialTypeId { get; set; }
        ///// <summary>
        ///// 物料类型
        ///// </summary>
        //public string MaterialTypeName { get; set; }
        ///// <summary>
        ///// 当前步骤：0-未执行；1-出进行中；2-出完成；3-入进行中；4-入完成
        ///// </summary>
        //public int? Step { get; set; }
        ///// <summary>
        ///// 是否需要移位
        ///// </summary>
        //public bool? IsNeedMove { get; set; }
        /// <summary>
        /// 库存id
        /// </summary>
        public int? InventoryId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public int? WarehouseId { get; set; }
    }
}
